﻿@using ECG.Utility
@using ECG.WebUI.CustomHelpers
@model ECG.Common.ProductCategoryDto
@{
    ViewBag.Title = (string.IsNullOrEmpty(Model.MetaTitle) ? Model.Name : Model.MetaTitle) + ViewBag.strPage;
    ViewBag.Description = (string.IsNullOrEmpty(Model.MetaDescription) ? Model.Name : Model.MetaDescription) + ViewBag.strPage;
    ViewBag.keywords = (string.IsNullOrEmpty(Model.MetaKeyword) ? Model.Name : Model.MetaKeyword) + ViewBag.strPage;
    Layout = "~/Views/Shared/_LayoutHideCate.cshtml";
    var cateMap = (List<ECG.Common.ProductCategoryMapLinkDto>)ViewBag.listCateMapLink;
}
@section headerProperty
{
    <meta property="og:image" content="@Model.ImagePath.ImagePathThumbDefault()" itemprop="thumbnailUrl" />
    <meta property="og:title" content="@Model.Name">
    <meta itemprop="description" property="og:description" content="@Model.MetaDescription">
    <meta property="og:url" content="@Request.Url" />
}
<div class="layout-width">
    @if (cateMap != null && cateMap.Any())
    {
        var cateByTop = from c in cateMap where c.Position == "top" orderby c.Ordering ascending select c;
        if (cateByTop.Any())
        {
            <div class="MapLink">
                <div class="ml-left">
                    <span>Nổi bật: </span>
                    @foreach (var item in cateByTop)
                    {
                        <a href="@item.Url">@item.Name</a>
                    }
                </div>
            </div>
        }
    }
    @Html.Action("Adv1ByCategory", "CategoryL1", new { category = Model.Id, w = 980, o = 0 })
    <div class="cate-page-box clearfix">
        <div class="cate-left-box fl">
            <div class="cate-list">
                @Html.Action("CategoryMenuLeft", "Category", new { categoryId = Model.Id })
            </div>
            @if (cateMap != null && cateMap.Any())
            {
                var cateByLeft = from c in cateMap where c.Position == "left" orderby c.Ordering ascending select c;
                if (cateByLeft.Any())
                {
                    <div class="CateMap_Left">
                        <div style="padding:10px;">
                            <p>
                                <strong>Danh mục liên quan</strong>
                            </p>
                            <p>
                                <ul class="ul">
                                    @foreach (var item in cateByLeft)
                                    {
                                        <li><a href="@item.Url">@item.Name</a></li>
                                    }
                                </ul>

                            </p>
                        </div>
                    </div>
                }
            }
            
            <div class="ProductFilter" id="plvProductFilter">
                <div class="filContainer">
                    @{
                        var modelFilter = (ECG.Common.CategoryFilterModel)ViewBag.CategoryFilModel;
                    }
                    @Html.Action("ProductFilterCategory", "Category", new { cateId = Model.Id, modelFil = modelFilter })
                </div>
            </div>


        </div>
        <div class="cate-right-box fl">
            @Html.Action("DirectionCategory", "Category", new { categoryId = Model.Id })
            <div class="p-summary">
                @Html.Raw(Model.SummaryCate)
            </div>
            @Html.Action("CategoryProductL3", "CategoryL3", new { categoryId = Model.Id, cateName = Model.Name, sortdrop = ViewBag.Fillter, catefil = ViewBag.CateFill  })
        </div>
    </div>
    <div class="right-footer-text">
        <div class="c-f-t-header">
            <a href="javascript:void(0);" rel="nofollow">
                @Model.Summary
            </a>
        </div>
        <div class="c-f-t-content">
            @Html.Raw(Model.Description)
        </div>
    </div>
</div>
@section scripts
{
    @Scripts.Render("~/bundles/categoryProduct")
    @Scripts.Render("~/bundles/QuickSearch")
    @Scripts.Render("~/bundles/filterCategory")
    @Scripts.Render("~/bundles/flexSlider")
    @Styles.Render("~/Content/flexSlider")
    @Scripts.Render("~/bundles/SliderRange")
    @Styles.Render("~/Content/SliderRange")
}